<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<p:dialog id="dialogCadastro" modal="true" width="50%" position="top"
	widgetVar="dialogCadastroTipoAnimal" closable="false"
	header="Cadastro de Tipo de Animal" appendTo="@(body)" resizable="true" draggable="true">
	<p:ajax event="close" listener="#{tipoAnimalMB.close}" update="frmDialogTipoAnimal" />
	<h:form id="frmDialogTipoAnimal">
	
		<h:panelGrid columns="2">

			<p:outputLabel value="Codigo:"></p:outputLabel>
			<p:inputText value="#{tipoAnimalMB.tipoAnimalSelecionado.codigo}"
				disabled="true"></p:inputText>

			<p:outputLabel value="Descrição:" for="iptdescricao"></p:outputLabel>
			<p:inputText id="iptdescricao" onfocus="iptdescricao"
				value="#{tipoAnimalMB.tipoAnimalSelecionado.descricao}" size="30"
				disabled="#{tipoAnimalMB.consultando}" required="true"
				requiredMessage="Descrição é obrigatória!" maxlength="40"></p:inputText>

		</h:panelGrid>
		<h:panelGrid columns="2" style="border:0px">
			<p:commandButton value="Confirma"
				actionListener="#{tipoAnimalMB.salvar}" 
				rendered="#{not tipoAnimalMB.consultando}" update="frmDialogTipoAnimal,:frmTab:tabela,:mensagem"
				oncomplete="validaDialog(args,'dialogCadastroTipoAnimal','frmDialogTipoAnimal:dialogCadastro')" />


			<p:commandButton value="Cancela"  id="btnFechar" immediate="true"
				onclick="dialogCadastroTipoAnimal.hide()" />

		</h:panelGrid>

	</h:form>
</p:dialog>

</html>